# script0904.py - May high temps (F) research with sets
# Author: Blum and Bresnahan
# Date:  May
################################################################
#
# Populate set with High Temps (F) during May 2015 in Indianapolis
print()
print("Enter the high temps (F) for May 2015 in Indianapolis...")
#
highMayTemp2015=set()		   #Create empty set
#
for may_date in range(1, 31 + 1):  #Loop to enter temps
#
	# Obtain high temp for date
	prompt="High temperature (F) May " + str(may_date) + " 2015: "
	high_temp=int(input(prompt))
        #
	# Put element in set
	highMayTemp2015.add(high_temp)
#
print()
print("The high temperatures (F) for May 2015 in a set are:")
print(highMayTemp2015)
#
#
################################################################
#
# Populate set with High Temps (F) during May 2014 in Indianapolis
print()
print("Enter the high temps (F) for May 2014 in Indianapolis...")
#
highMayTemp2014=set()              #Create empty set
#
for may_date in range(1, 31 + 1):  #Loop to enter temps
#
        # Obtain high temp for date
        prompt="High temperature (F) May " + str(may_date) + " 2014: "
        high_temp=int(input(prompt))
        # Put element in set
        highMayTemp2014.add(high_temp)
#
print()
print("The high temperatures (F) for May 2014 in a set are:")
print(highMayTemp2014)
#
################################################################
# Determine Shared High Temps for May
#
# Find intersetion of high temp sets
shared_temps=highMayTemp2015.intersection(highMayTemp2014)
#
# Print out determined data
print()
print("High Temps (F) Shared by May 2015 & May 2014")
print(sorted(shared_temps))
#
################################################################
# Determine Which Month was Cooler - May 2015 or May 2014
#
# Find difference of high temp sets
diff_temps2015=highMayTemp2015.difference(highMayTemp2014)
diff_temps2014=highMayTemp2014.difference(highMayTemp2015)
#
# Print out determined data
print()
print("Which month do you think was cooler?")
print("May 2015:", sorted(diff_temps2015))
print("                  or")
print("May 2014:", sorted(diff_temps2014))
#
######################################################### 
